<template>
	<view class="m-2">
		<swiper @change="getCurrentChange" :indicator-dots="true" indicator-color="rgba(0,0,0,.5)" indicator-active-color="#fff" :circular="true" :autoplay="true" style="height: 380rpx;">
			<swiper-item v-for="(item,index) in swiperImage" :key="index">
				<image :src="item.src" mode="aspectFill" class="w-100 animated " :class="currentImgIndex === index ? 'my-animate' : '' "></image>
			</swiper-item>
			
		</swiper>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	defineProps({
		swiperImage:{
			type:Array,
			default:()=>[]
		}
	})
	
	const currentImgIndex = ref(0)
	const getCurrentChange = (event)=>{
		console.log(event)
		currentImgIndex.value = event.detail.current
		console.log(currentImgIndex.value)
	}
</script>

<style>

</style> 